<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/css/layui.css">
    <link rel="stylesheet" href="/css/stu01.css">
    <script src="/js/jquery-3.7.1.min.js"></script>
</head>
<body>

<!--使用thymeleaf显示数据-->
<!--<table border="1">-->
<!--    <tr>-->
<!--        <th>id</th>-->
<!--        <th>student_id</th>-->
<!--        <th>name</th>-->
<!--        <th>age</th>-->
<!--    </tr>-->
<!--    <tr th:each="student : ${students}">-->
<!--        <th th:text="${student.id}"></th>-->
<!--        <th th:text="${student.student_id}"></th>-->
<!--        <th th:text="${student.name}"></th>-->
<!--        <th th:text="${student.age}"></th>-->
<!--    </tr>-->
<!--</table>-->

<!--使用layui美化显示的数据-->
<!--<div class="container">-->
<!--    <div class="layui-row">-->
<!--        <div class="layui-col-xs12">-->
<!--            <table class="layui-table">-->
<!--                <tr>-->
<!--                    <th>id</th>-->
<!--                    <th>student_id</th>-->
<!--                    <th>name</th>-->
<!--                    <th>age</th>-->
<!--                </tr>-->
<!--                <tr th:each="student : ${students}">-->
<!--                    <th th:text="${student.id}"></th>-->
<!--                    <th th:text="${student.student_id}"></th>-->
<!--                    <th th:text="${student.name}"></th>-->
<!--                    <th th:text="${student.age}"></th>-->
<!--                </tr>-->
<!--            </table>-->
<!--        </div>-->
<!--    </div>-->
<!--</div>-->
<!--<script src="/js/layui.js"></script>-->

<!--使用ajax显示数据-->
<!--<div class="container">-->
<!--    <div class="layui-row">-->
<!--        <div class="layui-col-xs12">-->
<!--            <h1 style="text-align: center">学生信息管理</h1>-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="layui-row">-->
<!--        <div class="layui-col-xs12 toolbar">-->
<!--            <button type="button" class="layui-btn layui-btn-normal"-->
<!--                    onclick="showStudentDlg();return false;">-->
<!--                <i class="layui-icon layui-icon-addition" style="font-size: 30px; color: white;"></i>-->
<!--            </button>-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="layui-row">-->
<!--        <div class="layui-col-xs12">-->
<!--            <table class="layui-table">-->
<!--                <thead>-->
<!--                    <tr>-->
<!--                        <th>id</th>-->
<!--                        <th>student_id</th>-->
<!--                        <th>name</th>-->
<!--                        <th>age</th>-->
<!--                        <th>编辑</th>-->
<!--                        <th>删除</th>-->
<!--                    </tr>-->
<!--                </thead>-->
<!--                <tbody id="studentTb">-->

<!--                </tbody>-->
<!--            </table>-->
<!--        </div>-->
<!--    </div>-->
<!--</div>-->
<!--<form class="layui-form dlgcontainer" id="stuForm" style="display: none">-->
<!--    <div class="demo-reg-container">-->
<!--        <div class="layui-form-item" id="formId">-->
<!--            <div class="layui-input-wrap">-->
<!--                <div class="layui-input-prefix">-->
<!--                    <i class="layui-icon layui-icon-username"></i>-->
<!--                </div>-->
<!--                <input type="text" name="id" value="" placeholder="id" autocomplete="off" class="layui-input" id="id" lay-affix="clear">-->
<!--            </div>-->
<!--        </div>-->
<!--        <div class="layui-form-item">-->
<!--            <div class="layui-input-wrap">-->
<!--                <div class="layui-input-prefix">-->
<!--                    <i class="layui-icon layui-icon-username"></i>-->
<!--                </div>-->
<!--                <input type="text" name="studentid" value="" lay-verify="required" placeholder="学号" autocomplete="off" class="layui-input" id="student_id" lay-affix="clear">-->
<!--            </div>-->
<!--        </div>-->
<!--        <div class="layui-form-item">-->
<!--            <div class="layui-input-wrap">-->
<!--                <div class="layui-input-prefix">-->
<!--                    <i class="layui-icon layui-icon-username"></i>-->
<!--                </div>-->
<!--                <input type="text" name="name" value="" lay-verify="required" placeholder="姓名" autocomplete="off" class="layui-input" id="name" lay-affix="clear">-->
<!--            </div>-->
<!--        </div>-->
<!--        <div class="layui-form-item">-->
<!--            <div class="layui-input-wrap">-->
<!--                <div class="layui-input-prefix">-->
<!--                    <i class="layui-icon layui-icon-username"></i>-->
<!--                </div>-->
<!--                <input type="text" name="age" value="" placeholder="年龄" autocomplete="off" class="layui-input" id="age" lay-affix="clear">-->
<!--            </div>-->
<!--        </div>-->
<!--        <div class="layui-form-item">-->
<!--            <button class="layui-btn layui-btn-fluid" id="btnOK" lay-submit lay-filter="stu-dlg">确定</button>-->
<!--        </div>-->
<!--    </div>-->
<!--</form>-->
<!--<script src="/js/layui.js"></script>-->
<!--<script src="/pagejs/stu01.js"></script>-->

<div class="container">
    <div class="layui-row">
        <div class="layui-col-xs12">
            <h1 style="text-align: center">学生信息管理</h1>
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-col-xs12 toolbar">
            <div class="layui-row">
                <button type="button" class="layui-btn layui-btn-normal"
                        onclick="showStudentDlg();return false;">
                    <i class="layui-icon layui-icon-addition" style="font-size: 30px; color: white;"></i>
                </button>
                <button type="button" class="layui-btn layui-btn-normal layui-bg-red"
                        onclick="deleteConfirm();" style="float: right;">
                    <i class="layui-icon layui-icon-delete" style="font-size: 30px; color: white;"></i>
                </button>
            </div>
            <div class="queryBox">
                <form action="" class="layui-form" id="queryForm">
                    <ul class="query-inline">
                        <li class="layui-input-group">
                            <div class="layui-input-prefix">
                                学号
                            </div>
                            <input type="text" placeholder="学号" class="layui-input" name="studentid">
                        </li>
                        <li class="layui-input-group">
                            <div class="layui-input-prefix">
                                姓名
                            </div>
                            <input type="text" placeholder="姓名" class="layui-input" name="name">
                        </li>
                        <li class="layui-input-group">
                            <div class="layui-input-prefix">
                                年龄
                            </div>
                            <input type="number" placeholder="年龄" class="layui-input" name="age">
                        </li>
                        <li class="layui-input-group">
                            <button type="button" class="layui-btn layui-btn-normal"
                            onclick="search();return false;" style="margin-left: 20px;">查询
                            </button>
                        </li>
                    </ul>
                </form>
            </div>
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-col-xs12">
            <table class="layui-hide" id="tbStudent" lay-filter="tbStudent"></table>
        </div>
    </div>
</div>

<script type="text/html" id="editTemplate">
    <div class="layui-clear-space">
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    </div>
</script>

<form class="layui-form dlgcontainer" id="stuForm" style="display: none">
    <div class="demo-reg-container">
        <div class="layui-form-item" id="formId">
            <div class="layui-input-wrap">
                <div class="layui-input-prefix">
                    <i class="layui-icon layui-icon-username"></i>
                </div>
                <input type="text" name="id" value="" placeholder="id" autocomplete="off" class="layui-input" id="id" lay-affix="clear">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-wrap">
                <div class="layui-input-prefix">
                    <i class="layui-icon layui-icon-username"></i>
                </div>
                <input type="text" name="studentid" value="" lay-verify="required" placeholder="学号" autocomplete="off" class="layui-input" id="student_id" lay-affix="clear">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-wrap">
                <div class="layui-input-prefix">
                    <i class="layui-icon layui-icon-username"></i>
                </div>
                <input type="text" name="name" value="" lay-verify="required" placeholder="姓名" autocomplete="off" class="layui-input" id="name" lay-affix="clear">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-wrap">
                <div class="layui-input-prefix">
                    <i class="layui-icon layui-icon-username"></i>
                </div>
                <input type="text" name="age" value="" placeholder="年龄" autocomplete="off" class="layui-input" id="age" lay-affix="clear">
            </div>
        </div>
        <div class="layui-form-item">
            <button class="layui-btn layui-btn-fluid" id="btnOK" lay-submit lay-filter="stu-dlg">确定</button>
        </div>
    </div>
</form>
<script src="/js/layui.js"></script>
<script src="/pagejs/stu01.js"></script>
</body>
</html>